home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_shw_powerroom_sluice.cog < prev    next >
Text File  |  1999-11-15  |  9KB  |  345 lines

  1. # Jones 3D Cog Script
  2. #
  3. # shw_PowerRoom_Sliuce.cog
  4. #
  5. # Sluiceway Alternating Script for the power room.
  6. #
  7. # [CMG]
  8. #
  9. # (C) 1997 LucasArts Entertainment Co. All Rights Reserved
  10. # ========================================================================================
  11.  
  12. symbols
  13.         
  14.     #    MESSAGES
  15.     message    startup        
  16.     message    user0        
  17.     message    user1
  18.     message    user2
  19.     message    arrived
  20.     
  21.     #    WATER SECTORS
  22.     sector  Awater0
  23.     sector  Awater1
  24.     sector  Awater2
  25.     sector  Awater3
  26.     sector  Awater4
  27.     sector  Awater5
  28.     sector  Awater6
  29.     
  30.     sector  Bwater0
  31.     sector  Bwater1
  32.     sector  Bwater2
  33.     sector  Bwater3
  34.     sector  Bwater4
  35.     sector  Bwater5
  36.     sector  Bwater6
  37.  
  38.     #    THE WATER CONE 3dos
  39.     thing     Acone  
  40.     thing     Bcone
  41.  
  42.     #    SPLASH EFFECT POSITION GHOSTS
  43.     thing    Aconemistpivot
  44.     thing    Aconemistobject1
  45.     thing    Aconemistobject2
  46.  
  47.     thing    Bconemistpivot
  48.     thing    Bconemistobject1
  49.     thing    Bconemistobject2
  50.             
  51.     #    SURFACES IN THE SLUICES
  52.     surface Awatersurf0
  53.     surface Awatersurf1
  54.     surface Awatersurf2
  55.     surface Awatersurf3
  56.     surface Awatersurf4
  57.     surface Awatersurf5
  58.     surface Awatersurf6
  59.     surface Awatersurf7
  60.  
  61.     surface Bwatersurf0
  62.     surface Bwatersurf1
  63.     surface Bwatersurf2
  64.     surface Bwatersurf3
  65.     surface Bwatersurf4
  66.     surface Bwatersurf5
  67.     surface Bwatersurf6
  68.     surface Bwatersurf7
  69.     
  70.     #    SOUNDS
  71.     sound    watersnd=shs_h2odrain_c.wav    local
  72.     
  73.     #    VARIABLES
  74.     int      thaw=0            local
  75.     int      index=0        local
  76.     int      aconerun=0        local
  77.     int      bconerun=0        local
  78.     int      soundrun=0        local
  79.     int      ringrun1        local
  80.     int      ringrun2        local
  81.     int      ringrun3        local
  82.     int      ringrun4        local
  83.     int      ringrun5        local
  84.     int      ringrun6        local
  85.     
  86.     #    TEMPLATES
  87.     template    mist=TitanicH2Ofx        local        
  88.     template    ring=+ripples    local
  89.     
  90.     # VECTORS
  91.     vector  sect_light      local
  92.     vector    ringstart        local
  93.     vector    ringend            local
  94. end
  95.  
  96. # ========================================================================================
  97. code
  98.  
  99. startup:
  100.  
  101.     Call Clearsluice1;
  102.     Call Clearsluice2;
  103.  
  104.     #    attach the particle and ring sprite objects to the pivot object for A
  105.     AttachThingToThing(Aconemistobject1, Aconemistpivot);
  106.     AttachThingToThing(Aconemistobject2, Aconemistpivot);
  107.  
  108.     #    attach the particle and ring sprite objects to the pivot object for B
  109.     AttachThingToThing(Bconemistobject1, Bconemistpivot);
  110.     AttachThingToThing(Bconemistobject2, Bconemistpivot);
  111.  
  112.     # setup vectors for the water ripple sprites
  113.     ringstart = VectorSet(0.1, 0.1, 1.0);
  114.     ringend    = VectorSet(0.3, 0.3, 0.0);
  115.  
  116. return;
  117.         
  118. # ========================================================================================
  119. Clearsluice1:    
  120. #pathA clearing
  121.  
  122. sect_light = VectorSet(0.0, 0.0, 0.0);
  123.  
  124.     for (index = 0; index <= 6; index = index + 1)
  125.         {
  126.         clearsectorflags(Awater0[index], 0x2);
  127.         setsectorlight(Awater0[index], sect_light, .1);
  128.         }
  129.     for (index = 0; index <= 7; index = index + 1)
  130.         {
  131.         Setfacegeomode(Awatersurf0[index], 0);
  132.         }
  133.         SetThingFlags(Acone, 0x80000);
  134.  
  135.         If (aconerun ==1)    # if the spray is running, stop it
  136.         {
  137.             aconerun=0;
  138.             StopThing(Aconemistpivot);
  139.             StopSound(soundrun,0);
  140.         }
  141. return;
  142.  
  143. # ========================================================================================
  144.     
  145. Clearsluice2:    
  146. #pathB clearing
  147.     
  148. sect_light = VectorSet(0.0, 0.0, 0.0);
  149.     for (index = 0; index <= 6; index = index + 1)
  150.         {
  151.         clearsectorflags(Bwater0[index], 0x2);
  152.         setsectorlight(Bwater0[index], sect_light, .1);
  153.         }
  154.     for (index = 0; index <= 7; index = index + 1)
  155.         {
  156.         Setfacegeomode(Bwatersurf0[index], 0);
  157.         }
  158.         SetThingFlags(Bcone, 0x80000);
  159.  
  160.         If (bconerun == 1)    # if the spray is running, stop it
  161.         {
  162.             bconerun=0;
  163.             StopThing(Bconemistpivot);
  164.             StopSound(soundrun,0);
  165.         }
  166.         
  167.  
  168. return;        
  169.  
  170. # ========================================================================================
  171. user1:
  172.  
  173.  
  174. sect_light = VectorSet(0.0, 0.2, 1.0);
  175.  
  176.     for (index = 0; index <= 6; index = index + 1)
  177.         {
  178.         setsectorflags(Awater0[index], 0x2);
  179.         setsectorlight(Awater0[index], sect_light, 3);
  180.         }
  181. #set faces to draw & set faces to full light
  182.     for (index = 0; index <= 7; index = index + 1)
  183.         {
  184.         setfacegeomode(Awatersurf0[index], 4);
  185.         setfacelightmode(Awatersurf0[index], 0);
  186.         }
  187.                         
  188. #create water object clean channelB
  189.         ClearThingFlags(Acone, 0x80000);
  190.         Call Clearsluice2;
  191.  
  192.         aconerun = 1;
  193.         Rotate(Aconemistpivot, 360, 1, 0.5);
  194.         soundrun=PlaySoundThing(watersnd, acone, 1, 6, 12, 0x1);
  195.         
  196.   
  197.                 
  198.         return;
  199.         
  200. # ========================================================================================
  201.  
  202.  
  203. user2:
  204.   
  205.  
  206. sect_light = VectorSet(0.0, 0.2, 1.0);
  207.  
  208.     for (index = 0; index <= 6; index = index + 1)
  209.         {
  210.         setsectorflags(Bwater0[index], 0x2);
  211.         setsectorlight(Bwater0[index], sect_light, 3);
  212.         }
  213. #set faces to draw & set faces to full light
  214.     for (index = 0; index <= 7; index = index + 1)
  215.         {
  216.         setfacegeomode(Bwatersurf0[index], 4);
  217.         setfacelightmode(Bwatersurf0[index], 0);
  218.         }
  219.                         
  220. #create water object
  221.         ClearThingFlags(Bcone, 0x80000);
  222.         Call Clearsluice1;
  223.  
  224.         bconerun = 1;
  225.         Rotate(Bconemistpivot, 360, 1, 0.5);
  226.                
  227.         soundrun=PlaySoundThing(watersnd, bcone, 1, 6, 12, 0x1);
  228.   
  229.         return;
  230.        
  231. # ========================================================================================
  232.  
  233. user0:
  234.  
  235.     Call Clearsluice1;
  236.     Call Clearsluice2;
  237.         
  238. return;
  239. # ========================================================================================
  240. arrived:
  241.  
  242. If ((GetSenderRef() == Aconemistpivot) && (aconerun == 1))
  243. {
  244.     
  245.     Rotate(Aconemistpivot, 360, 1, 0.5);
  246.     
  247.     #    create splash particles at center of system
  248.     CreateThing(mist, Aconemistpivot);
  249.     #    create the first ring at the center of the system
  250.     ringrun1=CreateThing(ring, Aconemistpivot); 
  251.     AnimateSpriteSize(ringrun1, ringstart, ringend, 0.75);
  252.     CreateThing(mist, Aconemistpivot);
  253.     
  254.     Sleep(0.1);
  255.     ringrun2=CreateThing(ring, Aconemistpivot); 
  256.     AnimateSpriteSize(ringrun2, ringstart, ringend, 0.75);
  257.     
  258.     
  259.     #    create splash particles at obj2 and center of system
  260.     CreateThing(mist, Aconemistpivot);
  261.     CreateThing(mist, Aconemistobject2);
  262.     CreateThing(mist, Aconemistpivot);
  263.     #    create the first ring at obj1 of the system
  264.     ringrun3=CreateThing(ring, Aconemistobject1); 
  265.     AnimateSpriteSize(ringrun3, ringstart, ringend, 0.75);
  266.  
  267.     Sleep(0.1);
  268.     
  269.     #    create splash particles at obj1 and center of system
  270.     CreateThing(mist, Aconemistobject1);
  271.     CreateThing(mist, Aconemistpivot);
  272.     #    create the first ring at obj2 of the system
  273.     ringrun4=CreateThing(ring, Aconemistobject2); 
  274.     AnimateSpriteSize(ringrun4, ringstart, ringend, 0.75);
  275.     CreateThing(mist, Aconemistobject2);
  276.     
  277.     Sleep(0.1);
  278.     
  279.     ringrun5=CreateThing(ring, Aconemistpivot); 
  280.     AnimateSpriteSize(ringrun5, ringstart, ringend, 0.75);
  281.  
  282.     #    create splash particles at obj1 and center of system
  283.     CreateThing(mist, Aconemistpivot);
  284.     CreateThing(mist, Aconemistobject2);
  285.     CreateThing(mist, Aconemistobject1);
  286.  
  287.     ringrun6=CreateThing(ring, Aconemistobject1); 
  288.     AnimateSpriteSize(ringrun6, ringstart, ringend, 0.75);
  289. }
  290.  
  291. If ((GetSenderRef() == Bconemistpivot) && (bconerun == 1))
  292. {
  293.     
  294.     Rotate(Bconemistpivot, 360, 1, 0.5);
  295.     
  296.     #    create splash particles at center of system
  297.     CreateThing(mist, Bconemistpivot);
  298.     #    create the first ring at the center of the system
  299.     ringrun1=CreateThing(ring, Bconemistpivot); 
  300.     AnimateSpriteSize(ringrun1, ringstart, ringend, 0.75);
  301.     CreateThing(mist, Bconemistpivot);
  302.     
  303.     Sleep(0.1);
  304.     ringrun2=CreateThing(ring, Bconemistpivot); 
  305.     AnimateSpriteSize(ringrun2, ringstart, ringend, 0.75);
  306.     
  307.     
  308.     #    create splash particles at obj2 and center of system
  309.     CreateThing(mist, Bconemistpivot);
  310.     CreateThing(mist, Bconemistobject2);
  311.     CreateThing(mist, Bconemistpivot);
  312.     #    create the first ring at obj1 of the system
  313.     ringrun3=CreateThing(ring, Bconemistobject1); 
  314.     AnimateSpriteSize(ringrun3, ringstart, ringend, 0.75);
  315.     CreateThing(mist, Bconemistobject2);
  316.  
  317.     Sleep(0.1);
  318.     
  319.     #    create splash particles at obj1 and center of system
  320.     CreateThing(mist, Bconemistobject1);
  321.     CreateThing(mist, Bconemistpivot);
  322.     #    create the first ring at obj2 of the system
  323.     ringrun4=CreateThing(ring, Bconemistobject2); 
  324.     AnimateSpriteSize(ringrun4, ringstart, ringend, 0.75);
  325.  
  326.     Sleep(0.1);
  327.     
  328.     ringrun5=CreateThing(ring, Bconemistpivot); 
  329.     AnimateSpriteSize(ringrun5, ringstart, ringend, 0.75);
  330.  
  331.     #    create splash particles at obj1 and center of system
  332.     CreateThing(mist, Bconemistpivot);
  333.     CreateThing(mist, Bconemistobject2);
  334.     CreateThing(mist, Bconemistobject1);
  335.  
  336.     ringrun6=CreateThing(ring, Bconemistobject1); 
  337.     AnimateSpriteSize(ringrun6, ringstart, ringend, 0.75);
  338. }
  339.  
  340. return;
  341. # ========================================================================================
  342.  
  343. end
  344.  
  345.